<template>
    <div>
    <div style="width: 100%; height: 50px;background-color: antiquewhite;"v-if="start" class="a">
      <van-button @click="aa" type="danger" round style="margin-left: 300px;" >
  <van-swipe
    vertical
    class="notice-swipe"
    :autoplay="2000"
    :touchable="false"
    :show-indicators="false"
  >
    <van-swipe-item>去登录</van-swipe-item>
    <van-swipe-item>未登录</van-swipe-item>
  </van-swipe>
</van-button>
    </div>
<van-tabbar route>
  <van-tabbar-item replace to="/home/index">首页</van-tabbar-item>
  <van-tabbar-item replace to="/home/cat" > 分类</van-tabbar-item>
  <van-tabbar-item replace to="/home/gwc" >购物车</van-tabbar-item>
  <van-tabbar-item replace to="/home/my"v-if="start">未登录</van-tabbar-item>
  <van-tabbar-item replace to="/home/my" v-else>我的</van-tabbar-item>
</van-tabbar>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRoute,useRouter } from 'vue-router';
const route = useRoute()
const router = useRouter()
const start=ref(true)
let token=localStorage.getItem('token')
const dl=()=>{
  if(!token){
    start.value=true
  }else{
    start.value=false
  }
}
dl()
const aa=()=>{
  router.push('/login')
}
</script>

<style lang="scss" scoped>
  .notice-swipe {
    height: 40px;
    line-height: 40px;
  }
  .a{
   position:absolute;
    left: 0;
    bottom: 60px;
  }
</style>